package com.wufun.overseas.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.wufun.overseas.R;


/**
 * Created by caowd on 2015/6/9.
 */
public class HandShankDialog extends Dialog {

    Context context;
    TextView name_tv;
    Button check_btn;
    TextView cancel_tv;


    public HandShankDialog(Context context, int theme) {
        super(context, theme);
        this.context = context;
    }

    public HandShankDialog(Context context) {
        super(context, R.style.dialog_error);
        this.context = context;

        View view = LayoutInflater.from(context).inflate(R.layout.dialog_handshank,null);
        setContentView(view);
        name_tv = (TextView) findViewById(R.id.name_tv);
        cancel_tv = (TextView) findViewById(R.id.cancel_tv);
        check_btn = (Button) findViewById(R.id.check_btn);


        setCancelable(false);
        setCanceledOnTouchOutside(false);



       /* cancel_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                //context.startActivity(new Intent(context,));
                dismiss();
            }
        });*/


    }

   /* @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);

        View view = LayoutInflater.from(context).inflate(R.layout.dialog_handshank,null);

        name_tv = (TextView) view.findViewById(R.id.name_tv);
        cancel_tv = (TextView) view.findViewById(R.id.cancel_tv);
        check_btn = (Button) view.findViewById(R.id.check_btn);

        setContentView(view);
        setCancelable(false);
        setCanceledOnTouchOutside(false);

        check_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                //context.startActivity(new Intent(context,));
                dismiss();
            }
        });

        cancel_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                //context.startActivity(new Intent(context,));
                dismiss();
            }
        });


    }*/


    public void setTitle(String name){
        name_tv.setText(name);
    }

    public void setCheckClick(View.OnClickListener onClickListener){
        check_btn.setOnClickListener(onClickListener);
    }

    public void setCancelClick(View.OnClickListener onClickListener){
        cancel_tv.setOnClickListener(onClickListener);
    }
}
